﻿@model VietPremier.Models.GetMenuModel
<script type="text/javascript">
    $(document).ready(function () {

        if (window.location.href.indexOf("TravelInformation") > -1) {

            $("#idTravel").addClass('active');
            return;
        }
        if (window.location.href.indexOf("TravelStyle") > -1) {

            $("#idTravelStyle").addClass('active');
            return;
        }
        if (window.location.href.indexOf("Destination") > -1) {

            $("#idDestination").addClass('active');
            return;
        }
        if (window.location.href.indexOf("DestinationCountry") > -1) {

            $("#idDestination").addClass('active');
            return;
        }
        if (window.location.href.indexOf("DestinationStyle") > -1) {

            $("#idDestination").addClass('active');
            return;
        }

        if (window.location.href.indexOf("Promotion") > -1) {

            $("#idPromotion").addClass('active');
            return;
        }
        if (window.location.href.indexOf("Inquiry") > -1) {

            $("#idInquiry").addClass('active');
            return;
        }
        if (window.location.href.indexOf("AboutUs") > -1) {

            $("#idAboutUs").addClass('active');
            return;
        }
        $("#idHome").addClass('active');
        return;
    });
</script>

<div class="navbar-inner">
    <div class="container">
        <ul class="nav">
            @foreach (var item in Model.listMenu)
            {
                if (item.Position == 1)
                {
                <li id="idHome"><a href="@Url.Action("Index", "Home")">@item.Name</a></li>
                }
                if (item.Position == 2)
                {
                <li class="dropdown" id="idTravel">
                    <a class="dropdown-toggle" data-toggle="" href="@Url.Action("Information", "TravelInformation")">@item.Name<b class="caret"></b></a>
                    <ul class="dropdown-menu">
                        @foreach (var travelProduct in Model.listTravelProduct)
                        {
                            <li><a href="@Url.Action("Product", "TravelInformation", new { title = Utilities.Encode(travelProduct.Name) })">@travelProduct.Name</a></li>
                        }
                    </ul>
                </li>
                }
                <!-- / dropdown-->
                if (item.Position == 3)
                {
                <li class="dropdown" id="idDestination">
                    <a class="dropdown-toggle" data-toggle="" href="@Url.Action("Index", "Destination")">@item.Name<b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        @foreach (var destinationArea in Model.listDestinationArea)
                        {
                            if (destinationArea.listDestinationCountry.Count > 0)
                            {
                            <li><a href="@Url.Action("DestinationCountryList", "Destination", new { title = Utilities.Encode(destinationArea.AreaName) })"><b class="caret"></b>@destinationArea.AreaName</a>
                                <ul>
                                    @foreach (var destinationCountry in destinationArea.listDestinationCountry)
                                    {
                                        <li><a href="@Url.Action("Destination", "Destination", new { title = Utilities.Encode(destinationCountry.Name), name = Utilities.Encode(destinationArea.AreaName) , })">@destinationCountry.Name</a></li>
                                    }
                                </ul>
                            </li>
                            }
                            else
                            {
                            <li><a href="@Url.Action("DestinationCountryList", "Destination", new { title = Utilities.Encode(destinationArea.AreaName) })">@destinationArea.AreaName</a>
                            </li>
                            }

                        }
                    </ul>
                </li>
                }
                <!-- / dropdown-->
                if (item.Position == 4)
                {
                <li class="dropdown" id="idTravelStyle">
                    <a class="dropdown-toggle" data-toggle="">@item.Name<b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        @foreach (var style in Model.listStyle)
                        {
                            <li><a href="@Url.Action("TravelStyle", "Style", new { title = Utilities.Encode(style.Name) })">@style.Name</a></li>
                        }
                    </ul>
                </li>
                
                }
                if (item.Position == 5)
                {
                <li id="idPromotion"><a href="@Url.Action("Index", "Promotion")">@item.Name</a></li>
                }
                <!-- / dropdown-->            
                if (item.Position == 6)
                {
                <li id="idInquiry"><a href="@Url.Action("Index", "Inquiry")">@item.Name</a></li>
                }
                if (item.Position == 7)
                {
                <li id="idAboutUs"><a href="@Url.Action("Index", "AboutUs")">@item.Name</a></li>
                }
            }
        </ul>
        <!-- / nav-->
    </div>
    <!-- /.container -->
</div>
<!-- /navbar-inner -->
